$(document).ready(function() {
	  
	 $("#selectedBankCode").change(function () {
         var bankCode = $(this).val();		 
         location.href=contextRoot+"/communicationlogdetails/view.html?bankCode="+ bankCode;
       });
	 
	 $("#updateBtn").click(function () {
		 $(".error").hide();
		 if(($("#communicationLogMessage").length && ($("#communicationLogMessage").val() == "")) || 
				 ($("#summaryLogMessage").length && $("#summaryLogMessage").val() == "")){
				$("#validation")
				.after(
						'<span class="error" style="color: red">Please enter log details.</span>');
				return false;
		 }
		 $("form").attr('action',contextRoot+"/communicationlogdetails/update.html")
	 }); 
	 $(".comm").click(function () { 
		    if ($(".commlog").is(":visible")) { 
		        $(this).next(".commlog").slideUp("fast"); 
		        $("td.commtd").children('span').text('+ '); 
		        $(".commlog").css("visibility", "hidden");
		    } else { 
		        $(this).next(".commlog").slideDown("fast"); 
		        $("td.commtd").children('span').text('- '); 
		        $(".commlog").css("visibility", "visible");
		    } 
		}); 
	 $(".sum").click(function () { 
		    if ($(".sumlog").is(":visible")) { 
		        $(this).next(".sumlog").slideUp("fast"); 
		        $("td.sumtd").children('span').text('+ '); 
		        $(".sumlog").css("visibility", "hidden");
		    } else { 
		        $(this).next(".sumlog").slideDown("fast"); 
		        $("td.sumtd").children('span').text('- '); 
		        $(".sumlog").css("visibility", "visible");
		    } 
		}); 	 
	});